﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microhard.Core.DBUtility;


namespace Microhard.ApproveWorkflow.Models
{
    public class WorkflowModel
    {
        public Guid WBSRID { set; get; }
        public Guid WorkflowInstanceID { set; get; }
        public Guid BusinessSheetID { set; get; }
        public string BusinessSheetResourceName { set; get; }
        public string BusinessSheetResourceKeyName { set; get; }
        public DateTime CreationDateTime { set; get; }
        public DateTime LatestModificationDateTime { set; get; }
        public string IsCompleteText
        {
            get
            {
                return this.IsComplete == true ? "已结束" : "未结束";
            }
        }
        public bool IsComplete { set; get; }
        public Guid CurrentActivityID { set; get; }
        public string CurrentActName { set; get; }
        public Guid NextActivityID { set; get; }
        public string NextActName { set; get; }
        public int Status { set; get; }
        public Guid FlowChartID { set; get; }
        public string FlowName { set; get; }
        public Guid FlowType { set; get; }
        public string FlowTypeName { set; get; }
        public Guid ApplierID { set; get; }
        public string ApplierName { set; get; }

        public List<ActivityModel> HasActivities { set; get; }
        public string BusSheetApproveControllerName { set; get; }
        public string BusSheetApproveViewName { set; get; }
        public string OperationKeyName { set; get; }

        public object model { set; get; }
        public bool UserHasAuthToAccessActivity { set; get; }
        public bool IsRefuse { set; get; }
        public ActivityModel CurrentActivity { get {
            return this.HasActivities.SingleOrDefault(a => a.IsCurrent);
        } }

        public string WFXAMLFileName { set; get; }
    }
}
